<?php

class Upload extends CI_Controller{
    
    function index(){
        $this->load->helper('form');
        
        $this->load->view('upload');
    }
    
    function do_upload(){
        $config['upload_path']='./upload/';
        $config['allowed_types']='gif|jpg|png';
        $config['max_size']='20000';
        $this->load->library('upload',$config);
        if($this->upload->do_upload('upfile')){
            $data=array('upload_data'=>  $this->upload->data());
            var_dump($data);
        }else{
            $error=array('upload_error'=>  $this->upload->display_errors());
            var_dump($error);
        }
        
    }
}

